<template>
  <view>
    <u-navbar title="企业信息">
      <template #right>
        <!--  -->
        <view class="edtbtn" @click="onedt"> 编辑 </view>
      </template>
    </u-navbar>
    <cardlist :data="formData" :list="inputs"></cardlist>
    <view style="height: 60rpx"></view>
  </view>
</template>

<script>
import { getCompanyInfo } from "@/api/company/companyInfo.js";
export default {
  data() {
    return {
      formData: {},
      inputs: [
        { label: "企业名称", prop: "enterpriseCompany" },
        { label: "统一社会信用代码", prop: "uscc" },
        { label: "公司注册时间", prop: "registerDate" },
        { label: "注册资本(万元)", prop: "registerCapital" },
        { label: "公司网址", prop: "enterpriseUrl" },
        { label: "企业法人", prop: "enterpriseLegalPerson" },
        { label: "企业联系人", prop: "enterpriseContactPerson" },
        { label: "联系人电话", prop: "enterpriseContactsTel" },
        { label: "企业注册地址", prop: "enterpriseRegAddress" },
        { label: "企业营业地址", prop: "enterpriseBusinessAddress" },
        { label: "企业营业周期", prop: "enterpriseBusinessCycle" },
        { label: "天眼查code", prop: "tianYanChaCode" },
        { label: "企业性质", prop: "enterpriseNature" },
        { label: "营业范围", prop: "businessScope" },
        { label: "邮箱", prop: "email" },
        { label: "公众号", prop: "officialAccount" },
        { label: "备注", prop: "remark" },
      ],
    };
  },
  onShow() {
    this.init();
  },
  methods: {
    async init() {
      let data = await getCompanyInfo();
      this.formData = data.data;
      this.formData.registerDate = this.$u.timeFormat(
        new Date(Number(this.formData.registerDate))
      );
    },
    onedt() {
      uni.navigateTo({
        url: "/pageswork/company/companyInfo/edit",
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.edtbtn {
  color: #1890ff;
  font-size: 28rpx;
}
</style>
